#include "cabecera.h"

int* generaVector(int nEle){
	return (int*)malloc(nEle*sizeof(int));
}

void ordenaBurbuja(int* vector, int nEle){
	int i,j,aux;
	for(i=1; i<nEle; i++){
		for(j=0; j<nEle-i; j++){
			if(vector[j] > vector[j+1]){
				aux = vector[j];
				vector[j] = vector[j+1];
				vector[j+1] = aux;
			}
		}
	}
}

void rellenaVector(int* vector, int nEle){
	int i;
	for(i=0; i<nEle; i++){
		printf("Introduzca el elemento %d del vector: ", i+1);
		scanf("%d", vector+i);
	}
}

void imprimeVector(int* vector, int nEle){
	int i;
	for(i=0; i<nEle; i++){
		printf("%d  ", *(vector+i));
	}
	printf("\n");
}